
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html"; charset="utf-8" />
<title></title>

<link href="../css/main.css" rel="stylesheet" type="text/css">
<style>
    .tab_style {
        height: 40px;
        line-height: 40px;
    }
    .right {
        float: right;
        display: flex;
        align-items: center;
        padding-right: 0px;
        
    }
    .right > div {
        border-left: 1px solid #ccc;
        display: flex;
        align-items: center;
        color: #333;
        padding: 0 20px;
        font-size: 15px;
        box-sizing: border-box;
    }
    .avatar {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        overflow: hidden;
        margin-right: 0px;
        cursor: pointer;
    }
</style>
</head>
<body>
    <div class="tab_style">
        所在位置：<a id="name"></a>
        <div class="right">
            <div>
                <img src="https://s1.ax1x.com/2020/05/09/YMQb4S.jpg" alt="" class="avatar">
                <span id="span" style="margin-left: -10px"></span>
            </div>
            <div>
                <img src="https://s1.ax1x.com/2020/05/09/YMld58.png" alt="" class="avatar" onclick="logout()">
            </div>
        </div>
    </div>


</body>

<script>
    var mobile = JSON.parse(localStorage.getItem('userInfo')).mobile
    document.getElementById('span').innerHTML = mobile

    setInterval(function(){
        var name = localStorage.getItem('name')
        document.getElementById('name').innerHTML = name
    }, 1000)

    function logout() {
        localStorage.clear()
        top.location.href = './login.html'
    }
</script>
</html>
